package com.ywger.integration.log;

import static com.ywger.integration.constants.log.LogFormat.SYS_INIT_BEGIN_LOG_FORMAT;
import static com.ywger.integration.constants.log.LogFormat.SYS_INIT_LOG_END_FORMAT;
import static com.ywger.integration.constants.log.LogFormat.SYS_INIT_LOG_FORMAT;
import org.slf4j.Logger;

/**
 * @author chenmeng
 * @date 2021-07-24 18:33
 * @desc
 */
public class InitLogger extends CommonLogger{




    public static void  start(Logger log, String componentName) {
        log.info(SYS_INIT_BEGIN_LOG_FORMAT, componentName);
    }

    public static void end(Logger log, String componentName) {
        log.info(SYS_INIT_LOG_END_FORMAT, componentName);
    }

    public static void info(Logger log, String componentName, String customFormatMsg, Object... arguments){
        String format = String.format(SYS_INIT_LOG_FORMAT,customFormatMsg);
        log.info(format,expand(componentName,arguments));
    }

    public static void warn(Logger log, String componentName, String customFormatMsg, Object... arguments){
        String format = String.format(SYS_INIT_LOG_FORMAT,customFormatMsg);
        log.warn(format,expand(componentName,arguments));
    }
}
